#pragma once

#define MAP_BLOCK_COUNT 8
#define MAP_BLOCK_SZIE (640/MAP_BLOCK_COUNT)

enum BLOCK_TYPE
{
	START_POINT,
	END_POINT,
	SPACE,
	BARRIER,
	VISITED,
	ON_PATH,
	VISITING,
};

class Model
{
public:
	Model();
	~Model();

private:
	int map[MAP_BLOCK_COUNT][MAP_BLOCK_COUNT];
	int startPos[2];
	int endPos[2];
	int hType;

public:
	int getHType();
	void setHType(int);

	int getStartX();
	int getStartY();
	int getEndX();
	int getEndY();

	int* getStartPoint();
	int* getEndPoint();
	void setStartPoint(int x, int y);
	void setEndPoint(int x, int y);

	int getBlockType(int x, int y);
	void setBlockType(int x, int y, int type);
	void setBarrier(int x, int y);
	void setSpace(int x, int y);

	void reset();
	void clear();
	int* tranform();
	bool check();

	void getBarriers(int list[], int &n);
};